package dl.demo.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
@EntityListeners(AuditingEntityListener.class)
public class Project {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    Integer id;
    String name;
    String introduction;
    boolean ispublic;

    @CreatedDate
    Date createtime;
    @LastModifiedDate
    Date edittime;

    Integer user_id,image_id;
    Integer stars=0,folks=0,views=0;

    public class Project_p extends Project{
        String username;
    }
}
